From: Florian Müllner Date: Tue, 19 May 2020 19:29:49 +0000 (+0200) Subject: environment: Replace monkey-patched method with Symbol.iterator X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~377 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e20cf1ac78810c8953d41b665a5f66c58e1c0628;p=gnome-shell.git environment: Replace monkey-patched method with Symbol.iterator This allows using the actor itself as iterator: for (let child of container) doStuff(child); https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1269 --- diff --git a/js/ui/environment.js b/js/ui/environment.js index 44a92db36..a0b884eb3 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -285,7 +285,7 @@ function init() { _easeActorProperty(this, 'value', target, params); }; - Clutter.Actor.prototype.iterate_children = function* () { + Clutter.Actor.prototype[Symbol.iterator] = function* () { for (let c = this.get_first_child(); c; c = c.get_next_sibling()) yield c; };